inherited dm_produtogrupo: Tdm_produtogrupo
  OldCreateOrder = True
  Left = 568
  Top = 287
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  g.cod_grupo,'
      '  g.descricao,'
      '  g.situacao,'
      '  case'
      '    when g.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      '  g.perc_descto,'
      '  g.data_cad,'
      '  g.data_alteracao,'
      
        '  (select count(p.cod_produto) from produto p where p.lig_cod_gr' +
        'upo = g.cod_grupo) as total_prod,'
      
        '  (select count(b.lig_cod_grupo) from produto_subgrupo b where b' +
        '.lig_cod_grupo = g.cod_grupo) as total_sub'
      'from PRODUTO_GRUPO g')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_GRUPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_GRUPO'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Required = True
      Size = 5
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaPERC_DESCTO: TFMTBCDField
      Alignment = taCenter
      FieldName = 'PERC_DESCTO'
      DisplayFormat = ',0.00'
      EditFormat = ',0.00'
      currency = True
      Precision = 15
      Size = 2
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaTOTAL_PROD: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_PROD'
    end
    object cdsConsultaTOTAL_SUB: TIntegerField
      Alignment = taCenter
      FieldName = 'TOTAL_SUB'
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_produto_grupo,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    OnReconcileError = cdsRegistroReconcileError
    object cdsRegistroCOD_GRUPO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_GRUPO'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroSITUACAO: TStringField
      Alignment = taCenter
      FieldName = 'SITUACAO'
      Required = True
      Size = 5
    end
    object cdsRegistroPERC_DESCTO: TFMTBCDField
      Alignment = taCenter
      FieldName = 'PERC_DESCTO'
      DisplayFormat = ',0.00'
      EditFormat = ',0.00'
      currency = True
      Precision = 15
      Size = 2
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'grupo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  g.cod_grupo,'
      '  g.descricao,'
      '  g.situacao,'
      '  g.perc_descto,'
      '  g.data_cad,'
      '  g.data_alteracao'
      'from PRODUTO_GRUPO g'
      'where g.cod_grupo = :grupo')
  end
end
